/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Conexion;

import java.sql.*;

/**
 *
 * @author ragnar
 */
public class conexion {
    
    static String bd = "Consultorio";
    static String user = "ragnar";
    static String pass = "internet";
    static String url = "jdbc:sqlserver://UNKNOWN-PC\\SQLEXPRESS;databaseName=" + bd;
    
    Connection con = null;

    public conexion() {
        try{
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(url,user,pass);
        }catch(SQLException | ClassNotFoundException e){
            System.out.println(e);
        }
    }
    
    public Connection getConexion(){
        return con;
    }
    public void desconectar(){
        con = null;
    }
    
    
    
}
